﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="StudyTime_1.quizMe"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StudyTime_1"
    xmlns:common="using:StudyTime_1.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">


    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="#FF00B159">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Quiz Me" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>
        
        <Grid Margin="10,5,0,0" x:Name="buttonGrid" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" >
            <Button x:Name="check" Content="Check" HorizontalAlignment="Left" Height="75" Margin="929.5,468,0,0" VerticalAlignment="Top" Width="252" Background="#00FF0404" Click="check_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto"  >
            <Button.RenderTransform>
                <CompositeTransform SkewX="20"/>
            </Button.RenderTransform>
        </Button>
        <Button x:Name="next" Content="Next" HorizontalAlignment="Left" Margin="945.2,535,0,0" VerticalAlignment="Top" Width="252"  Height="71" Click="next_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" >
            <Button.RenderTransform>
                <CompositeTransform SkewX="-20" TranslateX="-15" TranslateY="7" />
            </Button.RenderTransform>
        </Button>
        <Button x:Name="last"  Content="Previous" HorizontalAlignment="Left" Margin="99.2,535,0,0" VerticalAlignment="Top" Width="252" Height="75" Click="last_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto"  >
            <Button.RenderTransform>
                <CompositeTransform SkewX="20" TranslateX="-15" TranslateY="7" />
            </Button.RenderTransform>
        </Button>
            <Button x:Name="reviewBut"  Content="" HorizontalAlignment="Left" Height="75" Margin="86.7,468,0,0" VerticalAlignment="Top" Width="252" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Click="reviewBut_Click"  >
            <Button.RenderTransform>
                <CompositeTransform SkewX="-20"/>
            </Button.RenderTransform>
        </Button>
            <Button Content="Select Quiz" x:Name="selectCards" HorizontalAlignment="Left" Height="61" Margin="74,412,0,0" VerticalAlignment="Top" Width="143" RenderTransformOrigin="0.5,0.5"  Click="selection_Click" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="20"  TranslateX="15.421" TranslateY="-7.462"/>
                </Button.RenderTransform>
            </Button>
            <Border BorderBrush="White" BorderThickness="1" Height="439" HorizontalAlignment="Left" Margin="284,10,0,0" x:Name="border1" VerticalAlignment="Top" Width="691" CornerRadius="5">
            <TextBlock x:Name="questions" HorizontalAlignment="Left" Margin="3,11,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Height="419" Width="671" FontFamily="Segoe UI" FontSize="22" />
        </Border>
        <TextBox x:Name="answer" HorizontalAlignment="Left" Height="65" Margin="1030.408,397.5,0,0"  VerticalAlignment="Top" Width="149.092" IsSpellCheckEnabled="True" FontSize="24" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <TextBox.RenderTransform>
                    <CompositeTransform SkewX="-20"/>
                </TextBox.RenderTransform>
            </TextBox>
            <TextBlock x:Name="errorBox" HorizontalAlignment="Left" Height="85" Margin="927,-115,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="331" FontFamily="Segoe UI" FontSize="14" Foreground="Red" TextAlignment="Center"/>
        <TextBlock HorizontalAlignment="Left" Height="27" Margin="1021,364,0,0" TextWrapping="Wrap" Text="Answer" VerticalAlignment="Top" Width="121" FontSize="20" TextAlignment="Center"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
